<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

     if ($is_bind) {

    $open_id = $user->open_id;
    $user_type = $user->user_type;
    $up_ret = User::updateAll(["open_id" => $open_id, "user_type" => $user_type], 'mobile_phone =' . $mobile_phone);
    $del_ret = User::updateAll(["open_id" => ''], 'user_id =' . $user_id);
    ($up_ret && $del_ret) ? $this->_successData(null, "绑定成功") : $this->_errorData("0059", "绑定失败");
}